/*
*  CELabelBMFontIME.h 
*  LID Library  Cocos2d-x extentions
*
*  Created by Alexander Trutchenko on 10/01/12.
*  Copyright 2011 League of Independent Developers. All rights reserved.
*
*/


#ifndef __CE_LabelBMFontIME_h__
#define __CE_LabelBMFontIME_h__

#include "cocos2dx_extentions/labels/CELabelBMFont.h"


namespace cocosext{

////////////////////////////////////////////////////////
//
/** CELabelBMFontIME
* It is editable variant of CELabelBMFont 
*/
////////////////////////////////////////////////////////

class CELabelBMFontIME : public CELabelBMFont, public cocos2d::CCIMEDelegate
{
	std::string _utf8text;

protected:
	CELabelBMFontIME() {;}

public:	
		/** creates a bitmap font altas with an initial string and the FNT file */
	static CELabelBMFontIME * labelWithString(const wchar_t *str, const char *fntFile);

public:
	virtual ~CELabelBMFontIME() {;}

public:
// Main interface
    virtual bool attachWithIME();
    virtual bool detachWithIME();

// CELabelBMFont interface
	virtual void setString(const wchar_t *label);

// CCIMEDelegate interface
	virtual bool canAttachWithIME() const { return true; }
    virtual bool canDetachWithIME() const { return true; }
    virtual void insertText(const char * text, int len);
    virtual void deleteBackward();
	virtual const char * getContentText() const { return _utf8text.c_str(); }
};

}// namespace cocosext

#endif //__CE_LabelBMFontIME_h__
